'use strict';

const Controller = require('egg').Controller;

class LoginController extends Controller {
    //登录
  async login() {
    const { ctx } = this;
    let {name,pwd}=ctx.request.body;
    console.log(name,pwd);
    let res=await this.service.user.login(name);
    if(!res){
        ctx.body={
            code:404,
            age:"不存在用户"
        }
        return ;
    }
    
    if(res){

    }
    ctx.body = 'hi, egg';
  }
}

module.exports = LoginController;
